import Vue from 'vue'
import Router from 'vue-router'
import MusicBox from "../components/component/MusicBox";
import ColorScheme from "../components/page/ColorScheme";
import BlogCard from "../components/component/BlogCard";
import Index from "../components/page/Index"
import Editor from "../components/page/Editor";
import Login from "../components/page/Login";
import error from "../components/page/error";
import Md from "../components/component/Md";
import NotFound from "../components/page/NotFound";
import Register from "../components/page/Register";
import axios from "axios";

Vue.use(Router)

// const router = new VueRouter({
//   mode: 'history',
//   base: process.env.BABEL_ENV,
//   routes
// })

export default new Router({
  routes: [
    {
      path: '/register',
      component: Register
    },
    {
      path: '/music',
      component: MusicBox
    },
    {
      path: '/color',
      component: ColorScheme
    },
    {
      path: '/card',
      component: BlogCard
    },
    {
      path: '/index',
      component: Index,
      redirect: "/blog",
      children: [
        {
          path: "/blog",
          component: BlogCard
        },
        {
          path: "/md/:mid",
          component: Md
        }
      ]
    },
    {
      path: "/",
      component: Index,
      redirect: "/index"
    },
    {
      path: '/editor',
      component: Editor
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/error',
      component: error
    },
    {
      path: '/*',
      component: NotFound
    }
  ]
})
